﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasertTemplates.Master" AutoEventWireup="true"
    CodeBehind="Search.aspx.cs" Inherits="WebApplication.Search" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .styleSearch{ float: left; position:relative;}
        .Search_style_1{clear: both; border: 1px blue solid;overflow: hidden;height: auto;}
        .ClearBoth{clear: both;overflow:hidden;height:auto;}
        .Search_style_3{display:block; float:left; width:33%; line-height:25px; text-align:left; height:auto; overflow:hidden; font-size:12px;}
        .ChecklistStyle{ display:block; float:left; width:300px; line-height:25px; text-align:left; height:auto; overflow:hidden; font-size:12px;}
        .Search_MarginLeft{ margin-left:5px;}
        .clsWarningMeg{ color:Red;}
        .fsize{ font-size:10px;} 
        #PCategory{position:relative;overflow:hidden;}
        #BgDiv{background-color:#E0DED7; position:absolute; z-index:99; left:0; top:0; display:none; width:100%; height:1000px;opacity:0.5;filter: alpha(opacity=50);-moz-opacity: 0.5;}
        #DialogDiv{ text-align:center; position:absolute;width:200px; left:40%; top:50%; height:auto; z-index:100;background-color:#fff; border:1px #8FA4F5 solid; padding:1px;}
    </style>
    <link href="Media/Css/SearchStyle.css" rel="stylesheet" media="all" />
    <script src="Media/Js/Search.js" language="javascript" type="text/javascript"></script>
    <script type="text/javascript">
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="content-title">
        <h1>Search</h1>
    </div>
    <div class="con-nav">
        <a href="#" class="btn"><span class="ui-icon ui-icon-newwin"></span>Add New Customer</a>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
<asp:ScriptManager runat="server" ID="ScriptManager"></asp:ScriptManager>
<form action="#" id="SearchDetailInfo">
    <div class="partWrap">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td width="25%">
                    <p class="upinput">
                        Customer Name</p>
                        <asp:TextBox ID="CustomerName" runat="server" Width="205"></asp:TextBox>
                        <asp:AutoCompleteExtender ID="AutoCompleteExtender2" runat="server" 
                            TargetControlID="CustomerName" ServicePath=""  MinimumPrefixLength="1" UseContextKey="True" ServiceMethod="GetCustomerNameList" Enabled="true" DelimiterCharacters="" CompletionSetCount="10" CompletionInterval="100" EnableCaching="true">
                        </asp:AutoCompleteExtender> 
                </td>
                <td width="25%">
                    <p class="upinput">
                        Customer ID</p>
                    <asp:TextBox ID="CustomerID" runat="server" Width="205"></asp:TextBox>  
                    <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server"  TargetControlID="CustomerID" ServicePath="" MinimumPrefixLength="1" UseContextKey="True" ServiceMethod="GetCustomerIDList" Enabled="true" DelimiterCharacters="" CompletionSetCount="10" CompletionInterval="100">
                    </asp:AutoCompleteExtender> 
                </td>
                <td width="25%">
                    <p class="upinput">
                        Customer Type</p>
                    <%--<input type="text" class="input200" id="CustomerType"/>--%>
                    <asp:DropDownList ID="CustomerType" runat="server" DataTextField="CustType_Eng" Width="205" DataValueField="CustTypeUID">
                    </asp:DropDownList>
                </td>
                <td width="25%">
                    <p class="upinput">
                        Membership Since<span class="fsize">(eg.Jan 2010)</span>
                    </p>
                    <asp:TextBox runat="server" ID="MembershipSince" CssClass="input200" Width="205"></asp:TextBox>
                    <asp:CalendarExtender ID="MembershipSince_CalendarExtender" runat="server" Format="MMM yyyy" TargetControlID="MembershipSince">
                    </asp:CalendarExtender>
                    
                </td>
            </tr>
            <tr>
                <td>
                    <p class="upinput">
                        Membership Status</p>
                    <asp:DropDownList runat="server" ID="MembershipStatus" DataTextField="MemStatus_Eng" Width="205" 
                                DataValueField="MemStatusUID"></asp:DropDownList>
                    
                </td>
                <td>
                    <p class="upinput">
                        Brand Name</p>
                        <asp:TextBox runat="server" ID="BrandName"  Width="205"></asp:TextBox> 
                    
                    <asp:AutoCompleteExtender ID="AutoCompleteExtender3" runat="server" 
                        TargetControlID="BrandName" ServicePath="" MinimumPrefixLength="1" UseContextKey="True" ServiceMethod="GetBrandNameList" Enabled="true" DelimiterCharacters="" CompletionSetCount="10" CompletionInterval="100">
                    </asp:AutoCompleteExtender>
                </td>
                <td>
                    <p class="upinput">
                        Customer Introduction</p>
                    <input type="text" class="input200"id="CustomerIntroduction" />
                </td>
                <td>
                    <p class="upinput">
                        No. of Employee
                    </p>
                    <input type="text" class="input200" id="NoOfEmployee"/>
                </td>
            </tr>
            <tr>
                <td>
                    <p class="upinput">
                        Year Established<span class="fsize">(eg.2010)</span>
                    </p>
                    <asp:TextBox runat="server" ID="YeaEstablished" CssClass="input200" Width="205" ></asp:TextBox>
                    <asp:CalendarExtender ID="CalendarExtender_YeaEstablished" runat="server" Format="yyyy" TargetControlID="YeaEstablished">
                    </asp:CalendarExtender>
                </td>
                <td>
                    <p class="upinput">
                        BR</p>
                    <input type="text" class="input200" id="BR"/>
                </td>
                <td>
                    <p class="upinput">
                        HKID / Passport No.</p>
                    <input type="text" class="input200" id="HKIDPassportNo" />
                </td>
                <td>
                    <p class="upinput">
                        Year / Term<span class="fsize">(eg.2010/2011;2010-2013)</span></p>
                    <input type="text" class="input200" id="YearTerm"/>
                </td>
            </tr>
        </table>
        <div class="clear15">
        </div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="labelTb">
            <tr>
                <td width="25%">
                    <input type="checkbox" id="GC" value="1" /><label for="">GC</label>
                </td>
                <td width="25%">
                    <input type="checkbox" id="VIP" value="1" /><label for="">VIP</label>
                </td>
                <td width="25%">
                    <input type="checkbox" id="HQLocatHK" value="1" /><label for="">HQ Located in HK</label>
                </td>
                <td>
                </td>
            </tr>
        </table>
        <div class="clear15">
        </div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td>
                    <p class="upinput">
                        Address</p>
                    <input type="text" class="input200" id="Address" />
                </td>
                
                <td colspan="2">
                
                <asp:UpdatePanel runat="server" ID="UpdatePanel1">
                    <ContentTemplate>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr><td>                    
                    <p class="upinput">Continent</p>                        
                        <asp:DropDownList runat="server" ID="AreaInfo"  DataTextField="Area_Eng" Width="205" 
                                DataValueField="AreaUID" onselectedindexchanged="AreaInfo_SelectedIndexChanged" AutoPostBack="true" >
                        </asp:DropDownList>
                        </td><td>                   
                        <p class="upinput">Country</p>
                        <asp:DropDownList runat="server" ID="CountryInfo" DataTextField="Country_Eng" Width="205"/>                
                    </td></tr></table>
                </ContentTemplate>
                </asp:UpdatePanel>
                
                </td> 
                <td>
                    <p class="upinput">
                        Position</p>
                    <input type="text" class="input200" id="Position" />
                </td>
            </tr>
            <tr>
                <td><div id="EmailInfo">
                    <p class="upinput">
                        Email</p>
                    <input type="text" class="input200" id="Email" />
                    <br />
                    <div class="nextSelect">
                        <input type="checkbox" id="EmailSubscribe" value="1"/><label for="">Unsubscribe</label></div>
                    <span class="Warning" ></span>
                    </div>
                </td>
                <td>
                <div id="FaxInfo">
                    <p class="upinput">
                        Fax</p>
                    <input type="text" class="input200" id="Fax" />
                    <div class="nextSelect">
                        <input type="checkbox" id="FaxDNC" value="1"/><label for="">DNC</label>&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="checkbox" id="FaxUnsubscribe" value="1"/><label for="">Unsubscribe</label>
                    </div>
                    <span class="Warning" ></span>
                    </div>
                </td>
                <td>
                <div id="TelInfo">
                    <p class="upinput">
                        Telephone</p>
                    <input type="text" class="input200" id="Tel"/>
                    <div class="nextSelect">
                        <input type="checkbox" id="TelDNC" value="1"/><label for="">DNC</label>&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="checkbox" id="TelUnsubscribe" value="1"/><label for="">Unsubscribe</label>
                    </div>
                    <span class="Warning" ></span>
                    </div>
                </td>
                <td>
                    <p class="upinput">
                        Contact Person Name</p>
                    <input type="text" class="input200"id="ContactPersonName" />
                </td>
            </tr>
        </table>
        <div class="clear15">
        </div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="labelTb">
            <tr>
                <td width="25%">
                <p class="upinput">
                        Salutation</p>
                    <%--<input type="text" class="input200" id="Salutation"/>--%>
                    <asp:DropDownList runat="server" ID="Salutation" DataTextField="Salutation_Eng" Width="205"  DataValueField="SalutationUID"></asp:DropDownList>
                </td>
                <td width="50%">
                 <p class="upinput">
                        Committee Type</p>
                    <%--<input type="text" class="input200" id="CommitteeType" />--%>
                    <asp:DropDownList runat="server" ID="CommitteeType" 
                        DataTextField="CommType_Eng" Width="540px"  DataValueField="CommTypeUID">
                    </asp:DropDownList>
                 </td>
 
                <td width="25%">
                <p class="upinput">
                        Committee Position</p>                     
                    <asp:DropDownList ID="CommitteePosition" runat="server" DataTextField="CommPosition_Eng" Width="205" DataValueField="CommPositionUID">
                    </asp:DropDownList>
                
                </td>
            </tr>
        </table>
        <h4 class="title20">
            Attribute</h4>
            <div class="ClearBoth" id="GetAttribute">
            <asp:Repeater runat="server" ID="Attribute">
                <ItemTemplate>
                    <div class="Search_style_3">
                        <input type="checkbox" name="Attribute" value="<%#Eval("AttributeUID")%>" /><span class="Search_MarginLeft"><%#Eval("Attribute_Eng")%></span>
                    </div>
                </ItemTemplate>
            </asp:Repeater>
            </div>
        <h4 class="title20">
            Job Nature</h4>
            <div class="ClearBoth" id="JNature">
            <asp:Repeater runat="server" ID="JobNature">
                <ItemTemplate>
                    <div class="Search_style_3">
                        <input type="checkbox" name="JNature" value="<%#Eval("JobNatureUID").ToString()%>" /><span class="Search_MarginLeft"><%#Eval("JobNature_Eng")%></span>
                    </div>
                </ItemTemplate>
            </asp:Repeater>
            </div>
        <h4 class="title20">
            Business Nature</h4>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td width="80">
                    <select id="BNatureSelect">
                        <option>or</option>
                        <option>and</option>
                    </select>
                </td>
                <td>
                    <p class="italic">
                        Or 表示只要符合選擇的其中一個條件；And表示必須符合所選擇的所有條件。所以Or的搜索結果一定比And多。</p>
                </td>
            </tr>
        </table>
        <div class="ClearBoth" id="BNature">
        <asp:Repeater runat="server" ID="Business_Nature">
            <ItemTemplate>
                <div class="Search_style_3">
                     <input type="checkbox" name="BNature" value="<%#Eval("BusNatureUID")%>" /><span class="Search_MarginLeft"><%#Eval("BusNature_Eng")%></span>
                </div>
            </ItemTemplate>
        </asp:Repeater>
        </div>
        <h4 class="title20">
            Product Category</h4>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td width="80">
                    <select id="ProCategory">
                        <option>or</option>
                        <option>and</option>
                    </select>
                </td>
                <td>
                    <p class="italic">
                        Or 表示只要符合選擇的其中一個條件；And表示必須符合所選擇的所有條件。所以Or的搜索結果一定比And多。</p>
                </td>
            </tr>
        </table>
        <div class="productWrap" id="PCategory">
            <div id="BgDiv"></div>
            <!--遮罩层显示的DIV1-->
            <div id="DialogDiv" style="display:none">
                <div class="form">please wait...</div>
            </div>
            <div class="productTitle">
                <!--<h4>Main Market</h4> -->
            </div>
            <div class="CheckWrap">
                <ul class="menu1_ul menu1" id="menu1_ul1">
                    <li class="li1" id="ProCate_1">
                        <div class="selected">
                            √</div>
                        <span>Textile & Garment</span></li>
                    <li class="li2" id="ProCate_2">
                        <div class="selected" style="color: #ffffff;">
                            √</div>
                        <span>Electronics, AV & IT</span></li>
                    <li class="li3" id="ProCate_3">
                        <div class="selected" style="color: #ffffff;">
                            √</div>
                        <span>Houseware</span></li>
                    <li class="li4" id="ProCate_4">
                        <div class="selected">
                            √</div>
                        <span>Gifts & Premium</span></li>
                    <li class="li5" id="ProCate_5">
                        <div class="selected">
                            √</div>
                        <span>Others</span></li>
                </ul>
                <div id="menu_subs">
                <div class="notice_1">
                                    <span>Main Category(Can select more than one)</span>
                                    </div>
                    <asp:Repeater runat="server" ID="ProductCategory" OnItemDataBound="ProductCategory_ItemDataBound">
                        <ItemTemplate>
                            <div id="ProCate_<%#Convert.ToInt32(DataBinder.Eval(Container,"ItemIndex"))+1%>_1"
                                class="pro_cat1">                                
                                <div class="all_btn">
                                    <input type="checkbox" name="" id="Main_<%=mark_a %>" onclick="GetMainCheckBox(this.id,<%=mark_b%>)"/>
                                    <label for="Main_<%=mark_a %>"><strong>Select All / Unclick to clear all</strong></label>
                                 </div>
                                <div id="Main_<%=mark_a %>_all">
                                <ul class="sub3_cat_w">
                                    <asp:Repeater runat="server" ID="CategoryList">
                                        <ItemTemplate>
                                            <li>
                                                <input type="checkbox" name="<%#Eval("ProductCat_Eng").ToString().Trim()%>" id="Checkbox_<%=mark_a++%>" value="<%#Eval("ProductCatUID")%>"
                                                    onclick="GetProductSubCat(this.id,this.value,<%=mark_b %>,this.name)">
                                                <label for="Checkbox_<%=mark_a-1%>"><%#Eval("ProductCat_Eng")%>  <%#Eval("ProductCat_Chi")%></label>
                                            </li>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                    </ul>
                                </div>
                                <div id="SubCat_<%=mark_b++%>" class="ClearBoth">
                                </div>
                            </div>
                        </ItemTemplate>
                    </asp:Repeater>
                </div>
                <h4 class="title20">
                    Keyword</h4>
                <div>
                    <p class="upinput">
                        Product Specifications</p>
                    <input type="text" class="input200" id="ProductSpecifictions">
                </div>
            </div>
           </div>
            <div class="productTitle" style="width: 100%">
                <!-- -->
            </div>
            
                <h4 class="title20">
                    Main Market</h4>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="80">
                         <select id="Market">
                            <option>or</option>
                            <option>and</option>
                        </select>
                        </td>
                        <td>
                            <p class="italic">
                                Or 表示只要符合選擇的其中一個條件；And表示必須符合所選擇的所有條件。所以Or的搜索結果一定比And多。</p>
                        </td>
                    </tr>
                </table>
        <div class="productWrap">
          <div class="productTitle" style="width: 100%">
                <!-- -->
            </div>
                <div class="CheckWrap">
                <ul class="menu1_ul menu2" id="menu1_ul2">
                    <li class="li1" id="area_mn_1">
                        <div class="selected">
                            √</div>
                        <span>Africa</span></li>
                    <li class="li2" id="area_mn_2">
                        <div class="selected" style="color: #ffffff;">
                            √</div>
                        <span>Asia</span></li>
                    <li class="li3" id="area_mn_3">
                        <div class="selected" style="color: #ffffff;">
                            √</div>
                        <span>Australia</span></li>
                    <li class="li4" id="area_mn_4">
                        <div class="selected">
                            √</div>
                        <span>Europe</span></li>
                    <li class="li5" id="area_mn_5">
                        <div class="selected">
                            √</div>
                        <span>Middle East</span></li>
                    <li class="li6" id="area_mn_6">
                        <div class="selected">
                            √</div>
                        <span>North America</span></li>
                    <li class="li7" id="area_mn_7">
                        <div class="selected">
                            √</div>
                        <span>South America</span></li>
                </ul>
                <div class="clear20">
                </div>
                <!-- one -->
                <div id="MarArea">
                <asp:Repeater runat="server" ID="Area" onitemdatabound="Area_ItemDataBound" >
                    <ItemTemplate>
                    <div id="Area_<%#Convert.ToInt32(DataBinder.Eval(Container,"ItemIndex"))+1%>_1" class="pro_cat1">
                    <div class="all_btn">
                    <input type="checkbox" onclick="GetMarkCheckBox(this.id,<%=mark_d%>)" id="Country_<%=mark_c %>_all" />
                    <label><strong>Select All / Unclick to clear all</strong></label>
                    </div>
                       <ul class="sub3_cat_w">
                        <asp:Repeater runat="server" ID="Country" >
                            <ItemTemplate>
                                <li>
                                    <%--<input id='Checkbox1' type="checkbox" value="<%#Eval("Country_Eng")%>" name="MarArea"/>--%>
                                    <%--<input id='Country_<%=mark_c %>' type="checkbox" value="<%#Eval("Country_Eng")%>" name="MarArea" onclick="ClearClickByAll(this)"/>--%>
                                    <input id='Country_<%=mark_c %>' type="checkbox" value="<%#Eval("CountryUID")%>" name="MarArea" onclick="ClearClickByAll(this)"/>
                                    <label for='Country_<%#Eval("CountryUID")%>'><%#Eval("Country_Eng")%> <%#Eval("Country_Chi")%></label>
                                </li>
                            </ItemTemplate>
                        </asp:Repeater>
                        </ul>
                    </div>
                    <% mark_c++; %>
                    <div id="SubCat_<%=mark_d++%>" class="ClearBoth" style="display:none;">
                    </div>
                    </ItemTemplate>
                </asp:Repeater>
                </div>
                <h4 class="upinput">
                    Keyword</h4>
                <table width="500" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                            <p class="upinput">
                                Oversea Location</p>
                            <input type="text" class="input200" id="BranchAddress">
                        </td>
                        <td>
                            <p class="upinput">
                                Branch Name</p>
                            <asp:TextBox ID="BranchName" runat="server" Width="205"></asp:TextBox>
                        <asp:AutoCompleteExtender ID="AutoCompleteExtender4" runat="server" 
                            TargetControlID="BranchName" ServicePath=""  MinimumPrefixLength="1" UseContextKey="True" ServiceMethod="GetBranchNameList" Enabled="true" DelimiterCharacters="" CompletionSetCount="10" CompletionInterval="100" EnableCaching="true">
                        </asp:AutoCompleteExtender> 
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="clear20">
        </div>
        <table width="200" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td width="80">
                    <ul class="uibtn">
                        <li onclick="Save();"><span>Search</span></li>
                    </ul>
                </td>
                <td>
                    <ul class="uibtn">
                        <li onclick="javascript:ToggleDocument('wrapToggle')"><span>Quit</span></li>
                    </ul>
                </td>
            </tr>
        </table>
    </div>

    
    
  </form>
</asp:Content>